<?php

/**
 * xmlrpcController
 *
 * @author
 * @version
 */

class xmlrpcController extends Zend_Controller_Action {
	/**
	 * The default action - show the home page
	 */
	public function indexAction() {
		//        Zend_XmlRpc_Server_Fault::attachFaultException ( 'Services_Exception' );
		$server = new Zend_XmlRpc_Server ( );
		$server->setClass ( 'My_xmlrpc_blogger', 'blogger' );
		$server->setClass ( 'My_xmlrpc_metaWeblog', 'metaWeblog' );
		$server->setClass ( 'My_xmlrpc_wp', 'wp' );
		echo $server->handle ();
		//        $server->fault('gun')->setMessage('gun');
	//        Zend_XmlRpc_Fault::setCode(404);
	//		Zend_Debug::dump ( $server->blogger() );
	//		echo $server->fault ( '滚', 999 )->__toString ();
	

	}
	public function cAction() {
		$client = new Zend_XmlRpc_Client ( 'http://www.a.com/index.php/xmlrpc' );
		//		$client = new Zend_XmlRpc_Client ( 'http://www.zy2f.com/index.php/xmlrpc' );
		//		$client = new Zend_XmlRpc_Client ( 'http://www.myued.com/xmlrpc.php' );
		Zend_Debug::dump ( $client->call ( 'system.listMethods' ) );
	}
}